package com.dxf.chepter02

/**
 * 使用花括号{}替换小括号()
 *
 *
 */
object T25_花括号的时候和替换小括号 {
  def main(args: Array[String]): Unit = {
    for (i <- 1 to 3; j = i * 2) {
      println("i=" + i,"j="+j)
    }

    //等价
    println("==============================")
    for {i <- 1 to 3; j = i * 2} {
      println("i=" + i,"j="+j)
    }

    //等价
    println("==============================")
    for {i <- 1 to 3
         j = i * 2} {
      println("i=" + i,"j="+j)
    }


  }
}
